﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Event_cal.aspx.cs" Inherits="Event_cal"  Culture="en-US" UICulture="en-US"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Event_Calendar</title>
    <link  href="eSecretary.css" type="text/css" rel="Stylesheet"/>
</head>
<body>
     <div id="main">
       <div id="nav">
            <table id="menu">
             <tr>
                        <td><a href="Default.aspx">Log In</a> </td>

                        <td><a href="Event_cal.aspx">Calendar</a>
                        </td>
                        
                        <td><a href="Payment.aspx">Payment</a>
                        </td>

                        <td><a href="WeatherReport.aspx">Report</a>
                        </td>

                        
                    </tr>
                    
            </table>
            <img alt="" src="Images/logo.GIF" />eSecretary
     </div>
     <div id="content">
    <form id="form1" runat="server">
   
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:EventCalConnectionString %>" 
            SelectCommand="SELECT [Event_date] FROM [Event_cal]"></asp:SqlDataSource>
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:EventCalConnectionString %>" 
        DeleteCommand="DELETE FROM Event_cal WHERE Event_date=@Event_date" 
        InsertCommand="INSERT INTO Event_cal(Event_date, Event_todo) VALUES (@Event_date, @Event_todo)" 
        SelectCommand="SELECT * FROM [Event_cal]"
        UpdateCommand="UPDATE Event_cal SET Event_todo = @Event_todo WHERE (Event_date = @Event_date)">
        <SelectParameters>
            <asp:ControlParameter Name="Event_date" ControlID="Calendar1" PropertyName="SelectedDate" />
        </SelectParameters>
        <InsertParameters>
            <asp:ControlParameter Name="Event_date" ControlID="Calendar1" PropertyName="SelectedDate" />
        </InsertParameters>
    </asp:SqlDataSource>
     
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <div style="width:1000px">
    <div style="width:700px; float:left">
    <asp:Calendar ID="Calendar1" runat="server" ondayrender="Calendar1_DayRender" 
        onselectionchanged="Calendar1_SelectionChanged" Height="300px" 
            NextPrevFormat="ShortMonth" Width="80%" CssClass="cal" BorderStyle="Dotted" 
            Font-Size="12pt" SelectionMode="DayWeekMonth">
        <WeekendDayStyle ForeColor="#CC0000" />
        <TodayDayStyle BackColor="Lime" />
        <DayStyle Font-Size="8pt" Font-Underline="False" />
        <DayHeaderStyle Font-Bold="True" ForeColor="Black"/>
       

        <TitleStyle BackColor="#99CCFF" BorderStyle="Double" Font-Bold="True" 
            ForeColor="Black" />
       

        </asp:Calendar>
         <br />
    </div>
      
      <div id="formview" style="float:right">
        <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="Event_date" DataSourceID="SqlDataSource2" DefaultMode="Edit">
           <EditItemTemplate>
               <asp:Label ID="Event_cal" runat="server" AssociatedControlID="txtTodo" Text="Event_todo" CssClass="label"></asp:Label>
               <br />
               <asp:TextBox ID="txtTodo" runat="server" TextMode="MultiLine" Columns="30" Rows="5" Text="<% # Bind('Event_todo') %>"></asp:TextBox>
               <br />
               <asp:LinkButton ID="butUpdate" runat="server" Text="Quick Update" CommandName="Update" CssClass="linkBtn"></asp:LinkButton>
           </EditItemTemplate>
           <InsertItemTemplate>
               <asp:Label ID="Event_cal" runat="server" Text="Event_todo" AssociatedControlID="txtTodo" CssClass="label"></asp:Label>
               <br />
               <asp:TextBox ID="txtTodo" runat="server" Text="<% # Bind('Event_todo') %>" TextMode="MultiLine" Columns="30" Rows="5"></asp:TextBox>
               <br />
               <asp:Button ID="butInsert" runat="server" Text="Import"  CommandName="Insert" CssClass="addBtn"/>
           </InsertItemTemplate>
        </asp:FormView>
        <br />
        <asp:Button ID="butAddNew" runat="server" Text="Quick Add" OnClick="butAddNew_Click" CssClass="addBtn"/>
        <asp:Button ID="butCancel" runat="server" Text="Cancel" OnClick="butCancel_Click" CssClass="addBtn" />
         </div>  
        
        </div>           
    </ContentTemplate>
    </asp:UpdatePanel>
   
    
    
    </form>
       </div>
    
    </div>
</body>
</html>